define(function (require) {
  return function (context) {

    var i = 0;

    return {
      component: 'div',
      items: [
        {
          component: 'button',
          text: 'msg',
          onClick: function () {
            $.yvan.msg('msg:' + (i++));
          }
        },
        {
          component: 'button',
          text: 'alert1',
          onClick: function () {
            $.yvan.alert('alert:' + (i++));
          }
        },
        {
          component: 'button',
          text: 'alert2',
          onClick: function () {

            var html =
              "    return {\n" +
              "      component: 'div',\n" +
              "      items: [\n" +
              "        {\n" +
              "          component: 'button',\n" +
              "          text: 'msg',\n" +
              "          onClick: function () {\n" +
              "            $.yvan.msg('msg:' + (i++));\n" +
              "          }\n" +
              "        },\n" +
              "        {\n" +
              "          component: 'button',\n" +
              "          text: 'alert',\n" +
              "          onClick: function () {\n" +
              "            $.yvan.alert('alert:' + (i++));\n" +
              "          }\n" +
              "        }\n" +
              "      ]\n" +
              "    };";

            $.yvan.alert(html + '\n' + (i++));
          }
        },
        {
          component: 'button',
          text: 'confirm',
          onClick: function () {
            $.yvan.confirm('确认要这样做?' + (i++), {
              yes: function () {
                alert('yes');
              },
              no: function () {
                alert('no');
              }
            });
          }
        },
        {
          component: 'button',
          text: 'confirm',
          onClick: function () {
            $.yvan.confirm('确认要这样做2?' + (i++), {
              yes: function () {
                alert('yes');
              }
            });
          }
        }
      ]
    };

  };
});